<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>电价管理编辑--${site.name}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="description" content="${site.description}"/>
    <meta name="keywords" content="${site.keywords}"/>
    <meta name="author" content="${site.author}"/>
    <link rel="icon" href="${site.logo}">
    <link rel="stylesheet" href="${base}/static/layui/css/layui.css" media="all" />
    <style type="text/css">
        .layui-form-item .layui-inline{ width:33.333%; float:left; margin-right:0; }
        @media(max-width:1240px){
            .layui-form-item .layui-inline{ width:100%; float:none; }
        }
        .layui-form-item .role-box {
            position: relative;
        }
        .layui-form-item .role-box .jq-role-inline {
            height: 100%;
            overflow: auto;
        }

    </style>
</head>
<body class="childrenBody">
<form class="layui-form" style="width:80%;">
    <input value="${electricityElectrovalence.id}" name="id" type="hidden">
    <div class="layui-form-item">
        <label class="layui-form-label">电力用户名称</label>
        <div class="layui-input-block">
                <input  type="text" class="layui-input" value = "${electricityElectrovalence.eUsername}" name="eUsername"  placeholder="请输入电力用户名称">

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">电压等级</label>
        <div class="layui-input-block">
                <select name="voltageClasses" >
                    <option value="" selected="">请选择电压等级</option>
                    <@my type="electricity_company_user_voltage_grade">
                    <#list result as r>
                    <option value="${r.value}"  <#if (electricityElectrovalence.voltageClasses == r.value)> selected="" </#if>  >${r.label}</option>
                    </#list>
                    </@my>
                </select>

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">输配电价</label>
        <div class="layui-input-block">
                <input  type="text" class="layui-input" value = "${electricityElectrovalence.distributionPrice}" name="distributionPrice"  placeholder="请输入输配电价" onkeyup="var p2 = parseFloat(value).toFixed(2);value = p2>=0?(/\.0?$/.test(value)?value:p2.replace(/0$/,'').replace(/\.0$/,'')):''">

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">政府基金及附加</label>
        <div class="layui-input-block">
                <input  type="text" class="layui-input" value = "${electricityElectrovalence.governmenFunds}" name="governmenFunds"  placeholder="请输入政府基金及附加" onkeyup="var p2 = parseFloat(value).toFixed(2);value = p2>=0?(/\.0?$/.test(value)?value:p2.replace(/0$/,'').replace(/\.0$/,'')):''">

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">网损电价</label>
        <div class="layui-input-block">
                <input  type="text" class="layui-input" value = "${electricityElectrovalence.lossElectricity}" name="lossElectricity"  placeholder="请输入网损电价" onkeyup="var p2 = parseFloat(value).toFixed(2);value = p2>=0?(/\.0?$/.test(value)?value:p2.replace(/0$/,'').replace(/\.0$/,'')):''">

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">线损</label>
        <div class="layui-input-block">
                <input  type="text" class="layui-input" value = "${electricityElectrovalence.lineLoss}" name="lineLoss"  placeholder="请输入线损" onkeyup="var p2 = parseFloat(value).toFixed(2);value = p2>=0?(/\.0?$/.test(value)?value:p2.replace(/0$/,'').replace(/\.0$/,'')):''">

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">线损分担比例</label>
        <div class="layui-input-block">
                <input  type="text" class="layui-input" value = "${electricityElectrovalence.lineLossProportion}" name="lineLossProportion"  placeholder="请输入线损分担比例" onkeyup="var p2 = parseFloat(value).toFixed(2);value = p2>=0?(/\.0?$/.test(value)?value:p2.replace(/0$/,'').replace(/\.0$/,'')):''">

        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="addElectricityElectrovalence">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="${base}/static/layui/layui.js"></script>
<script>
    layui.use(['form','jquery','layer'],function(){
        var form      = layui.form,
                $     = layui.jquery,
                layer = layui.layer;


        form.on("submit(addElectricityElectrovalence)",function(data){
            var loadIndex = layer.load(2, {
                shade: [0.3, '#333']
            });
            //给角色赋值
            $.post("${base}/admin/electricityElectrovalence/edit",data.field,function(res){
                layer.close(loadIndex);
                if(res.success){
                    parent.layer.msg("电价管理编辑成功！",{time:1000},function(){
                        parent.layer.close(parent.editIndex);
                        //刷新父页面
                        parent.location.reload();
                    });
                }else{
                    layer.msg(res.message);
                }
            });
            return false;
        });

    });
</script>
</body>
</html>
